<?php

namespace App\Http\Controllers\Common;

use App\Models\Rbac\GuardUser;
use Illuminate\Http\Request;


abstract class GuardController extends CommonController {

    public function getGuardUser(Request $request) {
        $token = $request->header('token');
        $id = checkJWT($token)['id'];
        $record = (new GuardUser())->getGuardUserById($id);
        $record->has_permission = $record->hasPermissions();
        return responseSuccess($record->toArray());
    }

}
